\name{doInitClass}
\alias{doInitClass}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Create Initial Component for Nested Mixture Model
}
\description{
%%  ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{
doInitClass(d, class, n.class = 4, size.limit = 3)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{d}{
Matrix of Data (row:gene, column: sample).
}
  \item{class}{
%%     ~~Describe \code{class} here~~
}
  \item{n.class}{
Number of class
}
  \item{size.limit}{
%%     ~~Describe \code{size.limit} here~~
}
}
\details{
%%  ~~ If necessary, more details than the description above ~~
}
\value{
%%  ~Describe the value returned
%%  If it is a LIST, use
%%  \item{comp1 }{Description of 'comp1'}
%%  \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
Tomonori Oura
}
\note{
%%  ~~further notes~~
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
library(nmixclust)

#Generate simulated data
set.seed(123)
simData <- makeSimulationData(
	m=2000
	,n=200
	,prop.DE=0.5
	,effect.size=2
	,ngc=4
	,dist="norm"
	,model_type=1
)

#Data generated
str(simData)

#Normalization by median and mad of normal samples
non.cancer <- simData$class==1
d.med <- apply(simData$data[, non.cancer],1,median)
d.mad <- apply(simData$data[, non.cancer],1,mad)
d <- (simData$data - d.med) / d.mad

#Execute initialization
initClassList <- doInitClass(
	d=d
	,class=simData$class
	,n.class=c(2:6)
)

#Initialized gene/sample classes
str(initClassList)

}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
